package org.saxion.aktiehuis.services;

import org.saxion.aktiehuis.DAO.interfaces.KlantDAO;
import org.springframework.stereotype.Service;


public class KlantManagement {

	private KlantDAO klantDao;
	
	
	public int getKlantId(String klantNaam) throws Exception {	
		int i = klantDao.getKlantId(klantNaam);
		if(i == 0){
			int  f = this.addKlant(klantNaam);
			return f;
		}else{
			return i;
		}
	}

	public int addKlant(String klantNaam) throws Exception {
		return klantDao.addKlant(klantNaam);
	}

	public void setKlantDao(KlantDAO klantDao) throws Exception
	{
		this.klantDao = klantDao;
	}
}
